#!/bin/sh
# $Id: doplay,v 1.1 1994/12/24 20:19:17 suz Exp $

NETMAJ_LIB=./games
export NETMAJ_LIB

PORT=4114

if [ "$1" = "-p" ]
then
	PORT=$2
	shift
	shift
fi

if [ ! -d games ]
then
	mkdir games
	echo 000 > games/.seq
fi

CUR=`awk '{printf("%03d\n",\$1+1);}' <games/.seq`
echo $CUR >games/.seq
./server -p $PORT -n 1 -l games/$CUR.sv 
./auto -p $PORT -n auto-1  &
./auto -p $PORT -n auto-2  &
(sleep 3; ./auto -p $PORT -n auto-3 ) &
./client -p $PORT $*
